home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / EDITORS / ZAP130 / !Zap / Docs / E-Cursors < prev    next >
Text File  |  1993-12-13  |  3KB  |  75 lines

  1. *************************************************************************
  2. * >E-Cursors    Documents a cursor block format.            *
  3. *************************************************************************
  4.  
  5. Zap currently supports 3 cursors. Each has a cursor block. The addresses of
  6. the blocks can be read via Zap_ReadVar (See E-Vars). I will call them after
  7. the names of their pointers, ie, car_cursor, car_input, car_selection. The
  8. second is not usually used. It is used in cursor mode 2, when the cursors are
  9. split for keyboard copying.
  10.  
  11. The current cursor mode is stored in a variable called car_mode. Use
  12. Zap_ReadVar to get at this. Currently modes 0-5 are defined as below:
  13.  
  14. Mode:    Cursors updated on screen:    Use:
  15.  
  16. 0    car_selection            Zap hasn't got the input.
  17.     square where input should be
  18.  
  19. 1    car_cursor & car_selection    Standard editing
  20.                     cursor and input carets combined.
  21.  
  22. 2    car_cursor            Split cursor copying
  23.     car_input            car_cursor=moving cursor
  24.     car_selection            car_input=where input goes
  25.  
  26. 3    car_selection            Select area via keyboard
  27.                     car_cursor=current posn
  28.                     
  29. 4    car_selection            Select area via mouse
  30.                     car_cursor=current posn
  31.                     
  32. 5    car_input & car_selection    Select via mouse with CTRL held
  33.                     car_cursor=current posn
  34.                     car_input=fixed cursor
  35.  
  36. Internally, Zap also uses the modes:
  37.  
  38. -1    square where input should be    Caret 'temporarily' lost by Zap.
  39.     car_selection            (Eg it is in a menu item)
  40.  
  41. -2    car_selection only        Used as a temporary value to scrub
  42.                     carets from the screen.
  43.  
  44. The offsets of a cursor block have names beginning 'c_'. As usual, the
  45. E-Library file defines these offsets for you. They are described below. By
  46. convention, R10 is used to point to a cursor block.
  47.  
  48. c_wind
  49. Window offset of associated window (use Zap_ConvWindOff). This offset is -1
  50. if the cursor is not being used.
  51.  
  52. c_line        Current line cursor is on.
  53. c_col        Current column cursor is on (including margin).
  54. c_off        Current file offset of cursor.
  55. c_loff        Current file offset of start of physical line of cursor.
  56. c_width        Width of cursor in characters.
  57.  
  58. c_owind        Window of old cursor position.
  59. c_oline        Line of old cursor position.
  60. c_ocol        Column of old cursor position.
  61. c_owidth    Old cursor width.
  62.  
  63. The above meanings hold for car_cursor and car_input. For car_selection the
  64. current cursor position is the start of the selection and the old cursor
  65. position gives the end of the selection. Also c_owidth gives the end offset
  66. of the selection. c_width is unused. By start and end I mean logical start
  67. and end. Thus, it may not hold that the start comes before the end in the
  68. file.
  69.  
  70. To alter a cursors position you should first store the new position in the
  71. current position variables. The easiest way to do this is to store the new
  72. offset in c_off and then call Zap_UpdateCaret. You should then call Zap_Plot
  73. caret to move the caret on screen and update the old offset to the current
  74. offset. Zap_ReflectCaret combines these.
  75.